﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IXmlConstraintCollection
    {
        /// <summary>
        /// 添加约束
        /// </summary>
        /// <param name="property"></param>
        void And(IXmlConstraintProperty property);

        /// <summary>
        /// 添加or约束
        /// </summary>
        /// <param name="property"></param>
        void Or(IXmlConstraintProperty property);

        /// <summary>
        /// 添加对应节点名称的并且的条件
        /// </summary>
        /// <param name="elementname"></param>
        /// <returns></returns>
        IXmlConstraintPropertyFactory<T> And<T>(string propertyName);

        /// <summary>
        /// 添加对应节点名称的并且的条件
        /// </summary>
        /// <param name="elementname"></param>
        /// <returns></returns>
        IXmlConstraintPropertyFactory<string> And(string propertyName);

        /// <summary>
        /// 添加对应节点名称的或者的条件
        /// </summary>
        /// <param name="elementname"></param>
        /// <returns></returns>
        IXmlConstraintPropertyFactory<T> Or<T>(string propertyName);

        /// <summary>
        /// 添加对应节点名称的或者的条件
        /// </summary>
        /// <param name="elementname"></param>
        /// <returns></returns>
        IXmlConstraintPropertyFactory<string> Or(string propertyName);

        /// <summary>
        /// 判断是否有约束
        /// </summary>
        bool HasProperty { get;}

        /// <summary>
        /// 取得对应的节点名称
        /// </summary>
        string ElementName { get;}
    }
}
